package unify.data;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "episodes")
public class Episode implements Comparable<Episode> {
	@SuppressWarnings("unused")
	@DatabaseField(generatedId = true)
	private int databaseId;
	@DatabaseField
	private int number;
	@DatabaseField
	private String link;
	@DatabaseField
	private String linkLabel;
	@SuppressWarnings("unused")
	@DatabaseField(foreign = true, foreignAutoRefresh=true)
	private Season mySeason;
	
	/**
	 * Ormlite no-arg constructor
	 */
	public Episode() {
		super();
	}
	
	public Episode(int number, String link, String linkLabel, Season mySeason) {
		super();
		this.number = number;
		this.link = link;
		this.linkLabel = linkLabel;
		this.mySeason = mySeason;
	}
	
	public int getNumber() {
		return number;
	}
	
	public String getLink() {
		return link;
	}
	
	public void setLink(String link) {
		this.link = link;
	}

	public String getLinkLabel() {
		return linkLabel;
	}

	public void setLinkLabel(String linkLabel) {
		this.linkLabel = linkLabel;
	}

	@Override
	public int compareTo(Episode episode) {
		return this.number - episode.getNumber();
	}
}
